TLSConfiguration.certificateRequired attribute#413
Open
borisreitman wants to merge 4 commits intoapple:mainfrom
Open
TLSConfiguration.certificateRequired attribute#413borisreitman wants to merge 4 commits intoapple:mainfrom
borisreitman wants to merge 4 commits intoapple:mainfrom
Conversation
|
Can one of the admins verify this patch? |
9 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
dnadoba
reviewed
Dec 22, 2022
Author
|
@dnadoba Can you check it again, I pushed a new changeset. |
Lukasa
reviewed
Mar 21, 2023
|
|
||
| /// Whether to verify remote certificates. | ||
| public var certificateVerification: CertificateVerification | ||
| public var certificateRequired: Bool = true |
Contributor
There was a problem hiding this comment.
Can you add a doc comment to this explaining what it does and how it interacts with the above?
Contributor
|
@swift-server-bot test this please |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have implemented a new attribute
.certificateRequiredinTLSConfiguration. When set tofalse, it makes presence of client certificates optional. If the client certificate is provided, then thecustomVerificationCallbackwill be called. By default, the attribute is true, which is the current behaviour (failure without client certificate).From an article referenced below, here is a quote:
"[We] tell it to accept requests with no valid certificate. We need this to handle invalid connections as well (for example to display an error message), otherwise, they would just get a cryptic HTTPS error message from the browser (ERR_BAD_SSL_CLIENT_AUTH_CERT to be precise)"
Reference: https://medium.com/@sevcsik/authentication-using-https-client-certificates-3c9d270e8326